""""
字典的遍历
"""
""""
    使用.items()获取字典中的键值对元组
"""
c_dict = {
    "Nun":"水瓶座",
    "Nu":"金牛座",
    "N":"天枰座",
    }
for item in c_dict.items() :
    print(item)
"单独获取键和值"
for key,value in c_dict.items() :
    print(f"{key}星座是：{value}")

"遍历所有的键"
"""""
    使用.keys()方法获取字典中所有的键
"""
for name in c_dict.keys() :
    print(name)
"另外一种方式"
for name in c_dict :
    print(name)
"使用.keys()判断是否有值"
if "YC" not in c_dict.keys() :
    print("没有YC")

"遍历所有的值"
""""
    使用.values()方法获取遍历的值
"""
for cons in c_dict.values() :
    print(cons)
"打印以有的值，不重复打印"
for cons in c_dict.values() :
    print(cons)
